﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp
{
    public partial class 计算大小调整 : Form
    {

        int oldWidth = 0;
        int oldHeight = 0;

        public 计算大小调整()
        {
            InitializeComponent();
        }

        private void 计算大小调整_Resize(object sender, EventArgs e)
        {
            if (oldWidth == 0)
            {
                return;
            }
            int addWidth = this.Width - oldWidth;
            int addHeight = this.Height - oldHeight;
            button1.Width += addWidth;
            button1.Height += addHeight;
            oldWidth = this.Width;
            oldHeight = this.Height;
        }

        private void 计算大小调整_Load(object sender, EventArgs e)
        {
            oldWidth = this.Width;
            oldHeight = Height;
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}
